<?php

require_once('./roots.php');
require_once('./classes/rbac.php');

$rbac=new rbac();
//echo $_POST['login_id'];
$gui=$rbac->Buscar_rol_usuario(NULL,$_POST['login_id'],$_SESSION['sess_login_username']);
//var_dump($gui);

$user=$_POST['login_id'];
foreach ($gui as $key => $value) {
	
//echo "valor:".$value["id_role"]." <br /> User:".$user;
$aux=$rbac->Revocar_rol_usuario($value["id_role"],$user,$_SESSION['sess_login_username']);

}

$result=$rbac->Destruir_usuario($_POST['login_id'], $_SESSION['sess_login_username']);

header("Location:UsuarioListEliminar.php?result=".$result);


?>
